From 9d080c0934b848ee4a05013c78641e612fcc1e03 Mon Sep 17 00:00:00 2001
From: Dylan Cutler <dylancutler@google.com>
Date: Wed, 26 May 2021 16:39:52 +0000
Subject: [PATCH] Reland "Replace 'blacklist' with 'ignorelist' in
 ./tools/msan/."

This is a reland of 3b6263f2eece1264b052dfdcbc03b851d5abfb48

Relanding now that https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2897974 is merged

Original change's description:
> Replace 'blacklist' with 'ignorelist' in ./tools/msan/.
>
> Bug: 1097272, 1097268
> Change-Id: Id5c8227a5bfb1ffaec82d3168b609085b10c8297
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867730
> Commit-Queue: Dylan Cutler <dylancutler@google.com>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Jonathan Metzman <metzman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#883035}

Bug: 1097272
Bug: 1097268
Change-Id: I11a5bc8972680c95fb1dab95ed3b707ed76f4667
Cq-Include-Trybots: luci.chromium.try:chromeos-amd64-generic-cfi-thin-lto-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911096
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886773}
---
 build/config/sanitizers/BUILD.gn             | 44 ++++++++++----------
 build_overrides/build.gni                    | 14 +++----
 tools/msan/{blacklist.txt => ignorelist.txt} |  0
 3 files changed, 29 insertions(+), 29 deletions(-)
 rename tools/msan/{blacklist.txt => ignorelist.txt} (100%)

diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index aaaad023474d..55b388a43743 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -272,11 +272,11 @@ config("asan_flags") {
   if (is_asan) {
     cflags += [ "-fsanitize=address" ]
     if (is_win) {
-      if (!defined(asan_win_blacklist_path)) {
-        asan_win_blacklist_path =
+      if (!defined(asan_win_blocklist_path)) {
+        asan_win_blocklist_path =
             rebase_path("//tools/memory/asan/blocklist_win.txt", root_build_dir)
       }
-      cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ]
+      cflags += [ "-fsanitize-ignorelist=$asan_win_blocklist_path" ]
     }
   }
 }
@@ -306,13 +306,13 @@ config("link_shared_library") {
 config("cfi_flags") {
   cflags = []
   if (is_cfi && current_toolchain == default_toolchain) {
-    if (!defined(cfi_blacklist_path)) {
-      cfi_blacklist_path =
+    if (!defined(cfi_ignorelist_path)) {
+      cfi_ignorelist_path =
           rebase_path("//tools/cfi/ignores.txt", root_build_dir)
     }
     cflags += [
       "-fsanitize=cfi-vcall",
-      "-fsanitize-blacklist=$cfi_blacklist_path",
+      "-fsanitize-ignorelist=$cfi_ignorelist_path",
     ]
 
     if (use_cfi_cast) {
@@ -409,14 +409,14 @@ config("msan_flags") {
   if (is_msan) {
     assert(is_linux || is_chromeos,
            "msan only supported on linux x86_64/ChromeOS")
-    if (!defined(msan_blacklist_path)) {
-      msan_blacklist_path =
-          rebase_path("//tools/msan/blacklist.txt", root_build_dir)
+    if (!defined(msan_ignorelist_path)) {
+      msan_ignorelist_path =
+          rebase_path("//tools/msan/ignorelist.txt", root_build_dir)
     }
     cflags = [
       "-fsanitize=memory",
       "-fsanitize-memory-track-origins=$msan_track_origins",
-      "-fsanitize-blacklist=$msan_blacklist_path",
+      "-fsanitize-ignorelist=$msan_ignorelist_path",
     ]
   }
 }
@@ -424,13 +424,13 @@ config("msan_flags") {
 config("tsan_flags") {
   if (is_tsan) {
     assert(is_linux || is_chromeos, "tsan only supported on linux x86_64")
-    if (!defined(tsan_blacklist_path)) {
-      tsan_blacklist_path =
+    if (!defined(tsan_ignorelist_path)) {
+      tsan_ignorelist_path =
           rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir)
     }
     cflags = [
       "-fsanitize=thread",
-      "-fsanitize-blacklist=$tsan_blacklist_path",
+      "-fsanitize-ignorelist=$tsan_ignorelist_path",
     ]
   }
 }
@@ -438,8 +438,8 @@ config("tsan_flags") {
 config("ubsan_flags") {
   cflags = []
   if (is_ubsan) {
-    if (!defined(ubsan_blacklist_path)) {
-      ubsan_blacklist_path =
+    if (!defined(ubsan_ignorelist_path)) {
+      ubsan_ignorelist_path =
           rebase_path("//tools/ubsan/ignorelist.txt", root_build_dir)
     }
     cflags += [
@@ -456,7 +456,7 @@ config("ubsan_flags") {
       "-fsanitize=signed-integer-overflow",
       "-fsanitize=unreachable",
       "-fsanitize=vla-bound",
-      "-fsanitize-blacklist=$ubsan_blacklist_path",
+      "-fsanitize-ignorelist=$ubsan_ignorelist_path",
     ]
 
     # Chromecast ubsan builds fail to compile with these
@@ -486,8 +486,8 @@ config("ubsan_no_recover") {
 
 config("ubsan_security_flags") {
   if (is_ubsan_security) {
-    if (!defined(ubsan_security_blacklist_path)) {
-      ubsan_security_blacklist_path =
+    if (!defined(ubsan_security_ignorelist_path)) {
+      ubsan_security_ignorelist_path =
           rebase_path("//tools/ubsan/security_ignorelist.txt", root_build_dir)
     }
     cflags = [
@@ -495,7 +495,7 @@ config("ubsan_security_flags") {
       "-fsanitize=shift",
       "-fsanitize=signed-integer-overflow",
       "-fsanitize=vla-bound",
-      "-fsanitize-blacklist=$ubsan_security_blacklist_path",
+      "-fsanitize-ignorelist=$ubsan_security_ignorelist_path",
     ]
   }
 }
@@ -508,13 +508,13 @@ config("ubsan_null_flags") {
 
 config("ubsan_vptr_flags") {
   if (is_ubsan_vptr) {
-    if (!defined(ubsan_vptr_blacklist_path)) {
-      ubsan_vptr_blacklist_path =
+    if (!defined(ubsan_vptr_ignorelist_path)) {
+      ubsan_vptr_ignorelist_path =
           rebase_path("//tools/ubsan/vptr_ignorelist.txt", root_build_dir)
     }
     cflags = [
       "-fsanitize=vptr",
-      "-fsanitize-blacklist=$ubsan_vptr_blacklist_path",
+      "-fsanitize-ignorelist=$ubsan_vptr_ignorelist_path",
     ]
   }
 }
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
index 82627b03653f..f3e563ab701b 100644
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -42,15 +42,15 @@ declare_args() {
 # Allows different projects to specify their own suppression/ignore lists for
 # sanitizer tools.
 # asan_suppressions_file = "path/to/asan_suppressions.cc"
-# asan_win_blacklist_path = "path/to/asan/blocklist_win.txt"
+# asan_win_ignorelist_path = "path/to/asan/blocklist_win.txt"
 # lsan_suppressions_file = "path/to/lsan_suppressions.cc"
 # tsan_suppressions_file = "path/to/tsan_suppressions.cc"
-# tsan_blacklist_path = "path/to/tsan/ignores.txt"
-# msan_blacklist_path = "path/to/msan/blacklist.txt"
-# ubsan_blacklist_path = "path/to/ubsan/blacklist.txt"
-# ubsan_vptr_blacklist_path = "path/to/ubsan/vptr_blacklist.txt"
-# ubsan_security_blacklist_path = "path/to/ubsan/security_blacklist.txt"
-# cfi_blacklist_path = "path/to/cfi/ignores.txt"
+# tsan_ignorelist_path = "path/to/tsan/ignores.txt"
+# msan_ignorelist_path = "path/to/msan/ignorelist.txt"
+# ubsan_ignorelist_path = "path/to/ubsan/ignorelist.txt"
+# ubsan_vptr_ignorelist_path = "path/to/ubsan/vptr_ignorelist.txt"
+# ubsan_security_ignorelist_path = "path/to/ubsan/security_ignorelist.txt"
+# cfi_ignorelist_path = "path/to/cfi/ignores.txt"
 
 declare_args() {
   # Android 32-bit non-component, non-clang builds cannot have symbol_level=2
diff --git a/tools/msan/blacklist.txt b/tools/msan/ignorelist.txt
similarity index 100%
rename from tools/msan/blacklist.txt
rename to tools/msan/ignorelist.txt
